#region Using directives

/*
 * Copyright (c) 2005-2007 Alan Dean.
 * All rights reserved.
 */

using System;
using System.Collections.Generic;
using System.Globalization;

using ObjectThinking.Globalization;
using ObjectThinking.Xml.ResourceDescriptionFramework;

#endregion

namespace ObjectThinking
{
    public static class Rule
    {
        // public static methods

        public static void ClearViolations(IRule rule)
        {
            foreach (KeyValuePair<Uri, Object> pair in rule)
            {
                if (pair.Value is IViolation) rule.Remove(pair.Key);
            }
        }

        public static bool IsValid(IRule rule)
        {
            bool valid = true;

            foreach (KeyValuePair<Uri, Object> pair in rule)
            {
                if (pair.Value is IViolation)
                {
                    valid = false;
                    break;
                }
            }

            return valid;
        }
    }
}